package cn.bdqn.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import cn.bdqn.dao.RepairMapper;
import cn.bdqn.entity.Repair;
import cn.bdqn.entity.UsersAndRepair;
import cn.bdqn.util.Page;
@Service("repairService")
public class RepairServiceImpl implements RepairService {
	@Autowired
	private RepairMapper repairMapper;
	@Override
	public Integer saveRepair(Repair repair) {
		return repairMapper.saveRepair(repair);
	}
	@Override
	public List<Repair> queryAllRepairByUserid(Integer userid) {
		return repairMapper.queryAllRepairByUserid(userid);
	}
	@Override
	public Integer updateRepair(Repair repair) {
		return repairMapper.updateRepair(repair);
	}
	@Override
	public void queryAllRepairByguan(String context, Page<UsersAndRepair> page) {
		Integer count=repairMapper.queryCountRepair(context);
		page.setTotalCount(count);
		List<UsersAndRepair> list=repairMapper.queryAllRepairByguan(context, page.getStart(), page.getPageSize());
		page.setList(list);
	}
	@Override
	public Integer updateRepairChuStatus(Repair repair) {
		return repairMapper.updateRepairChuStatus(repair);
	}
	@Override
	public UsersAndRepair queryRepairByrepirid(Integer repairid) {
		return repairMapper.queryRepairByrepirid(repairid);
	}

}
